package com.zadtek.shopmall.activities;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.zadtek.shopmall.R;
import com.zadtek.shopmall.base.AbsActivity;
import com.zadtek.shopmall.bean.WithdrawItem;

public class WithdrawItemDetailActivity extends AbsActivity {
    // Content View Elements

    private TextView tv_title;
    private TextView tv_money;
    private TextView tv_status;
    private TextView tv_time;
    private TextView tv_fee;
    private TextView tv_member;
    private TextView tv_admin;
    private TextView cancel;
    private TextView topTitle;
    private ImageView icBack;
    private WithdrawItem withdrawItem;

    // End Of Content View Elements

    private void initView() {

        tv_title = (TextView) findViewById(R.id.tv_title);
        tv_money = (TextView) findViewById(R.id.tv_money);
        tv_status = (TextView) findViewById(R.id.tv_status);
        tv_time = (TextView) findViewById(R.id.tv_time);
        tv_fee = (TextView) findViewById(R.id.tv_fee);
        tv_member = (TextView) findViewById(R.id.tv_member);
        tv_admin = (TextView) findViewById(R.id.tv_admin);
        cancel = (TextView) findViewById(R.id.cancel);
        topTitle = findViewById(R.id.title);
        topTitle.setText("提现记录详情");
        icBack = findViewById(R.id.ic_back);
        icBack.setVisibility(View.VISIBLE);
    }


    @Override
    public int setView() {
        return R.layout.activity_withdraw_item_detail;
    }

    @Override
    public void initBasic(Bundle savedInstanceState) {
        initView();
        initlogic();
    }

    private void initlogic() {
        icBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        cancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        withdrawItem = (WithdrawItem) getIntent().getSerializableExtra("data");
        if(withdrawItem!=null){
            updateView();
        }
    }

    private void updateView() {
        tv_title.setText(withdrawItem.getType());
        tv_money.setText(withdrawItem.getAmount());
        tv_time.setText(withdrawItem.getAdd_time());
        tv_status.setText(withdrawItem.getPay_status());
        tv_admin.setText(withdrawItem.getShort_admin_note());
        tv_member.setText(withdrawItem.getShort_user_note());
        tv_fee.setText("手续费￥0.00");
    }
}
